

<html>
<head>
<style type="text/css" media="only screen and (max-device-width: 480px)">
table {width:100%; font-family:Arial, Helvetica, sans-serif;}
a {font-family:Arial, Helvetica, sans-serif; font-size:80px; font-weight:bold;}
font {font-size:50px;}
.font {font-size:40px;}
td {width:65%;}
input {width:90; height:100}
</style>
</head>
<body>
<?php
session_start();

$_SESSION['dbhost'] = 'engr-db.engr.oregonstate.edu:3307';
$_SESSION['dbname'] = 'funkecd';
$_SESSION['dbuser'] = 'funkecd';
$_SESSION['dbpass'] = 'ktrDtj1b';
$mysql_handle = mysql_connect($_SESSION['dbhost'], $_SESSION['dbuser'], $_SESSION['dbpass'])
    or die("Error connecting to database server");

mysql_select_db($_SESSION['dbname'], $mysql_handle)
    or die("Error selecting database: $dbname");

$fdata = array();
$sdata = array();
$tdata = array();

$i = 0;
$j = 0;
for($i = 1; $i <= 8; $i++)
{
	$j = 1;
	$query = "SELECT Team_Member_List.member_name, Team_Member_List.member_email
	FROM Team_Member_List, Call_List
	WHERE (Call_List.trid = " . $i . " 
	AND Call_List.call_number = ". $j ." AND Call_List.tmid = 		Team_Member_List.tmid);";

	$j++;
	$result = mysql_query($query);

	$fdata[$i] = mysql_fetch_array($result);

	$query = "SELECT Team_Member_List.member_name, Team_Member_List.member_email
	FROM Team_Member_List, Call_List
	WHERE (Call_List.trid = " . $i . " 
	AND Call_List.call_number = ". $j ." AND Call_List.tmid = 		Team_Member_List.tmid);";
	$j++;
	$result = mysql_query($query);

	$sdata[$i] = mysql_fetch_array($result);

	$query = "SELECT Team_Member_List.member_name, Team_Member_List.member_email
	FROM Team_Member_List, Call_List
	WHERE (Call_List.trid = " . $i . " 
	AND Call_List.call_number = ". $j ." AND Call_List.tmid = 		Team_Member_List.tmid);";

	$result = mysql_query($query);

	$tdata[$i] = mysql_fetch_array($result);

}

mysql_close($mysql_handle);
$i = 0;
echo '
<form method="post" action="IssueSummons.php">
<font size = "6" face= Arial, Helvetica, sans-serif>Summon Team</font><br>
<font face= Arial, Helvetica, sans-serif>
<table>
<b><h3><font color="blue">The following medical personel will be summoned on the call</font></b></h3>
<tr><td>
</p>

<font>
Obstetrician: <td>

<select class = "font" name="Obstetrician" class="txtbox">
<option value="' . $fdata[1]['member_email'] . '">'. $fdata[1]['member_name'] .' </option>
<option value="' . $sdata[1]['member_email'] . '">'. $sdata[1]['member_name'] .' </option>
<option value="' . $tdata[1]['member_email'] . '">'. $tdata[1]['member_name'] .' </option>
</select>
<tr><td>


<font>
Surgical Assistant:<td>
<select class = "font" name="Surgical_Assistant" class="txtbox">
<option value="' . $fdata[2]['member_email'] . '">'. $fdata[2]['member_name'] .' </option>
<option value="' . $sdata[2]['member_email'] . '">'. $sdata[2]['member_name'] .' </option>
<option value="' . $tdata[2]['member_email'] . '">'. $tdata[2]['member_name'] .' </option>
</select>
<tr><td>

<font>
Anesthetist: <td>
<select class = "font" name="Anesthetist" class="txtbox">
<option value="' . $fdata[3]['member_email'] . '">'. $fdata[3]['member_name'] .' </option>
<option value="' . $sdata[3]['member_email'] . '">'. $sdata[3]['member_name'] .' </option>
<option value="' . $tdata[3]['member_email'] . '">'. $tdata[3]['member_name'] .' </option>
</select>
<tr><td>

<font>
OB Nurse:<td>
<select class = "font" name="OB_Nurse" class="txtbox">
<option value="' . $fdata[4]['member_email'] . '">'. $fdata[4]['member_name'] .' </option>
<option value="' . $sdata[4]['member_email'] . '">'. $sdata[4]['member_name'] .' </option>
<option value="' . $tdata[4]['member_email'] . '">'. $tdata[4]['member_name'] .' </option>
</select>
<tr><td>

<font>
Scrub Nurse:<td>
<select class = "font" name="Scrub_Nurse" class="txtbox">
<option value="' . $fdata[5]['member_email'] . '">'. $fdata[5]['member_name'] .' </option>
<option value="' . $sdata[5]['member_email'] . '">'. $sdata[5]['member_name'] .' </option>
<option value="' . $tdata[5]['member_email'] . '">'. $tdata[5]['member_name'] .' </option>
</select>
<tr><td>

<font>
Circulating Nurse:<td>
<select class = "font" name="Circulating_Nurse" class="txtbox">
<option value="' . $fdata[6]['member_email'] . '">'. $fdata[6]['member_name'] .' </option>
<option value="' . $sdata[6]['member_email'] . '">'. $sdata[6]['member_name'] .' </option>
<option value="' . $tdata[6]['member_email'] . '">'. $tdata[6]['member_name'] .' </option>
</select>
<tr><td>

<font>
Family Practice Physician: <td>
<select class = "font" name="Physician" class="txtbox">
<option value="' . $fdata[7]['member_email'] . '">'. $fdata[7]['member_name'] .' </option>
<option value="' . $sdata[7]['member_email'] . '">'. $sdata[7]['member_name'] .' </option>
<option value="' . $tdata[7]['member_email'] . '">'. $tdata[7]['member_name'] .' </option>
</select>
<tr><td>

<font>
Respiratory Therapist: <td>
<select class = "font" name="Therapist" class="txtbox">
<option  value="' . $fdata[8]['member_email'] . '">'. $fdata[8]['member_name'] .' </option>
<option value="' . $sdata[8]['member_email'] . '">'. $sdata[8]['member_name'] .' </option>
<option value="' . $tdata[8]['member_email'] . '">'. $tdata[8]['member_name'] .' </option>
</select>

</table>

<hr>   <!--horizontal line-->
<font face= Arial, Helvetica, sans-serif>
<b><h3><font color="blue">Summons Data</font></b></h3>
<font face= Arial, Helvetica, sans-serif>
<table>
<tr><td><font>
Patient First Name: <td>
<input type="text" name="fname"/> 
<tr><td><font>
Patient Last Name: <td>
<input type="text" name="lname"/> 
<tr><td><font>
Patient Status: <td> 
<input type="text" name="status"/>
<option value="A">  
<tr><td><font>
Assembly Location:<td>  <select class = "font" name="lid" class="txtbox">
<option value="1"> OR 1 </option>
<option value="2"> OR 2 </option>
</select>
</table>
<br><br>
<center><INPUT TYPE="submit" NAME ="Summon Team" Value ="Summon Team"></center>	 
</form>
</td>
</tr>
</table>
</body>
</html>
';
?>
